<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue中给组件绑定原生事件</title>
    <script src="../vue.js"></script>
   
</head>
<body>
    <div id="app">
           <!-- <child @click=“handleClick”></child> -->
           <child @click.native=“handleClick”></child>
    </div>   
    
    <script>
      
        Vue.component('child',{          
            //template: '<div @click="handleChildClick">Child</div>',
            // methods:{
            //     handleChildClick: function(){
            //         this.$emit('click')
            //     }
            // }
            template: '<div>Child</div>',
        })
    
        var root = new Vue({
            el: '#app',
            methods:{
                handleClick: function(){
                   alert('click');
                }
            }
           
        });
    </script>
</body>
</html>